<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sites</title>
<link href="/css/admin.css" rel="stylesheet" type="text/css" />
<script src="/js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="/js/datepicker/datepicker.js" type="text/javascript"></script>
<link href="/js/datepicker/datepicker.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

	var instance = new baidu.ui.DatePicker({calendarOptions: { highlightDates: [new Date("2010/4/7")]}});
	var instance2 = new baidu.ui.DatePicker({calendarOptions: { highlightDates: [new Date("2010/4/7")]}});
	
	$(function () {
		instance.render("dtbegin");
		instance2.render("dtend");		
    });

    function renderTable(){
    	$('.commonTable tr').hover(function () {
			$(this).css('background-color', '#ffffae');
		},
        function () {
        	$(this).css('background-color', '#FFFFFF');
        });
    }
	
	function chkall(obj){
		$("input:checkbox[name='chk']").attr('checked', obj.checked);
	}

	function choosecol(){
		var sid = $("#sid").val();
		window.open('/cms/choosecol/' + sid,'请选择栏目','width=350,height=300,left=' + (screen.availWidth - 350) / 2 + ',top=' + (screen.availHeight - 300) / 2);
	}
	function setcol(parm){		
		var ary = parm.split('|');
		if(ary.length == 2){
			var cid = ary[0];
			var cname = ary[1];
			$("#cname").val(cname);
			$("#cid").val(cid);
		}
	}
	function mysearch(){
		if($("#cname").val() == "")
			$("#cid").val('');

		$.post("/cms/dosearchart", { 			
			sid: $("#sid").val(), 
			cid: $("#cid").val(),
			title: $("#title").val(),
			dtbegin: $("#dtbegin").val(),
			dtend: $("#dtend").val(),
			createby: $("#createby").val(),
			astatus: $("#astatus").val(),
			atype: $("#atype").val(),
			pagenum: $("#pagenum").val()
			},function (data) {
				$("#datatablediv").html(data);
				renderTable();
		});
	}
	function goPage(pnum){
		$("#pagenum").val(pnum);
		mysearch();
	}
	function editart(aid){
		window.open("/cms/editart/" + aid + "/popup",'编辑文档','width=800,height=600');
	}
	function delart(aid){
		if(confirm('确定删除？')){
			$.get("/cms/delart/null/" + aid ,function (data) {
					if(data == 'ok')
						mysearch();
					else
						alert(data);
			});
		}
	}
	function chkall(obj){
		$("input:checkbox[name='chk']").attr('checked', obj.checked);
	}
</script>
<style type="text/css">
	.shorttxt{width:80px;}
</style>
</head>
<body>
	<div class="listTitle">文档查询</div>
	<!-- <form name="form1" action="/cms/searchart" method="post" > -->
	<div class="btnDiv" style="background-color:#E5ECF9;margin-bottom:10px;">
		<table >
			<tr><td>网站&nbsp;<select id="sid" name="sid" ><?php foreach($sites as $key=>$value){?><option value="<?=$key?>"><?=$value?></option><?php }?></select>&nbsp;&nbsp;栏目&nbsp;<input type="text" id="cname" name="cname" value="" /><input type="hidden" id="cid" name="cid" value="" /><input type="button" value="..." onclick="choosecol()"></td></tr>
			<tr><td>标题&nbsp;<input type="text" id="title" name="title"/>&nbsp;&nbsp;发布时间&nbsp;<input type="text" id="dtbegin" name="dtbegin" class="shorttxt" value="<?=$dtbegin?>" /> - <input type="text" id="dtend" name="dtend" class="shorttxt" value="<?=$dtend?>" />&nbsp;&nbsp;发布人&nbsp;<input type="text" class="shorttxt" id="createby" name="createby" value="<?=$createby?>" />&nbsp;&nbsp;状态&nbsp;<select id="astatus" name="astatus" ><option value="">全部</option><option value="0">待审</option><option value="1">已审</option></select>&nbsp;&nbsp;类型&nbsp;<select id="atype" name="atype"><option value="">全部</option><option value="0">文档</option><option value="1">附件</option><option value="2">超链接</option></select>&nbsp;&nbsp;<input type="hidden" id="pagenum" name="pagenum" value="0"/><input  type="button" value="  查询  " onclick="mysearch()" /></td></tr>
		</table>
	</div>
	<div id="datatablediv"></div>
	<!-- </form> -->
</body>
</html>